package com.ruoyi.aidesign.config;

/**
 * MinIO配置类
 */
public class MinioConfig {
    // MinIO服务器地址
    private static final String DEFAULT_ENDPOINT = "http://114.55.56.174:19000";
    // MinIO访问密钥
    private static final String DEFAULT_ACCESS_KEY = "minioadmin";
    // MinIO秘密密钥
    private static final String DEFAULT_SECRET_KEY = "minioadmin";
    // MinIO存储桶名称
    private static final String DEFAULT_BUCKET_NAME = "heye";

    /**
     * 获取MinIO服务器地址
     */
    public static String getEndpoint() {
        String envEndpoint = System.getenv("MINIO_ENDPOINT");
        return (envEndpoint != null && !envEndpoint.isEmpty()) ? envEndpoint : DEFAULT_ENDPOINT;
    }

    /**
     * 获取MinIO访问密钥
     */
    public static String getAccessKey() {
        String envAccessKey = System.getenv("MINIO_ACCESS_KEY");
        return (envAccessKey != null && !envAccessKey.isEmpty()) ? envAccessKey : DEFAULT_ACCESS_KEY;
    }

    /**
     * 获取MinIO秘密密钥
     */
    public static String getSecretKey() {
        String envSecretKey = System.getenv("MINIO_SECRET_KEY");
        return (envSecretKey != null && !envSecretKey.isEmpty()) ? envSecretKey : DEFAULT_SECRET_KEY;
    }

    /**
     * 获取MinIO存储桶名称
     */
    public static String getBucketName() {
        String envBucketName = System.getenv("MINIO_BUCKET_NAME");
        return (envBucketName != null && !envBucketName.isEmpty()) ? envBucketName : DEFAULT_BUCKET_NAME;
    }
}
